var webpack = require('webpack');
var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');



module.exports = {
    watcher:true,
    //插件项
    plugins: [commonsPlugin],
    //页面入口文件配置

    module: {
        //加载器配置
        loaders: [
            { test: /\.jsx$/i, loader: 'jsx-loader?harmony' },
            {
                test: /\.js|\.jsx$/i,
                exclude: /(node_modules|bower_components)/,
                loader: 'babel-loader',
                query: {
                    presets: [
                        "latest",
                        "react",
                        "stage-0"
                    ],
                    plugins: [
                        "transform-decorators-legacy"
                    ]
                }
            }
            //{ test: /\.css$/, loader: 'style-loader!css-loader' },

            //{ test: /\.scss$/, loader: 'style!css!sass?sourceMap'},
            //{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'}
        ]
    },
    //其它解决方案配置
    resolve: {
        //root: __dirname+'/src', //绝对路径
        extensions: ['', '.js', '.json', '.jsx'],
        alias: {},
        externals: {
            'react': 'React'
        }
    }


};